import 'package:base_lib/config.dart';
import 'package:base_lib/index.dart';
import 'package:base_lib/common/network/net.dart';
import 'package:base_lib/common/network/result_body.dart';

class DictionaryHttp {
  static HttpManager _httpProxyIns;

  static createHttpProxy(
      {mBaseUrl = Config.loginBaseUrl,
      codeName = Config.codeName,
      codeSuccessValue = Config.codeSuccessValue,
      msgName = Config.msgName,
      reqTimeOut = Config.reqTimeOut,
      respTimeOut = Config.respTimeOut,
      logTag = "dictionary"}) {
    _httpProxyIns = HttpManager(
      mBaseUrl,
      CODE_NAME: codeName,
      CODE_SUCCESS_VALUE: codeSuccessValue,
      MSG_NAME: msgName,
      REQ_TIME_OUT: reqTimeOut,
      RESP_TIME_OUT: respTimeOut,
      LOG_TAG: logTag,
    );
  }

  /// 获取字典
  static const String INTERFACE_DOCTOR_DICTIONARY =
      "api/peachUser/sysdict/list";

  ///获取字典
  static Future<ResultBody> getDictionary(
      {systemCode, groupCode, parentDictCode}) {
    return _httpProxyIns.get(INTERFACE_DOCTOR_DICTIONARY, (resMap) {
      return resMap;
    },
        queryParams: Map()
          ..["systemCode"] = systemCode
          ..["groupCode"] = groupCode
          ..["parentDictCode"] = parentDictCode);
  }
}
